<template>
	<view>
		<view class="ttop">
			<uni-datetime-picker returnType="timestamp" v-model="range" type="daterange" @change="change" />
		</view>
		<view class="list">
			<view class="item" v-for="(item,index) in list" :key="index" >
				<view class="">
					<view class="t1">提现</view>
					<view class="time">{{item.createtime_string}}</view>
				</view>
				<view class="price">
					-{{item.price}}
				</view>
			</view>
		</view>
		<view class="kong" v-if="list.length == 0">
			<image src="/static/kong.png" mode=""></image>
			<view class="">
				暂无数据
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				params:{
					mid:uni.getStorageSync('msg').id,
					limit:15,
					page:1,
					start_time:'',
					end_time:'',
				},
				list:[]
			};
		},
		onLoad() {
			this.getlist()
		},
		onReachBottom() {
			this.params.page++
			this.getlist()
		},
		methods:{
			change(e){
				this.params.start_time = e[0]
				this.params.end_time = e[1]
				this.params.page = 1
				this.list = []
				this.getlist()
			},
			getlist(){
				this.$post('distribution/withdraw_list',this.params).then(res => {
					if (res.code == 0) {
						this.list.push(...res.data.list)
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
		box-sizing: border-box;
	}
	.kong {
		margin: 150rpx auto;
		text-align: center;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 26rpx;
		color: #000000;
		image {
			width: 228rpx;
			height: 228rpx;
			margin-bottom: 20rpx;
		}
	}
	.ttop{
		position: sticky;
		top: 0%;
		padding: 10rpx 30rpx 0rpx;
		background: #fff;
		z-index: 1;
	}

	.list {
		padding: 10rpx 30rpx;
		.item {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin: 20rpx auto;
			border-bottom: 1px solid #D1D1D6;
			padding-bottom: 20rpx;
			.t1 {
				font-family: PingFang SC, PingFang SC;
				font-weight: bold;
				font-size: 32rpx;
				color: #000000;
			}

			.time {
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: #979797;
				margin-top: 5rpx;
			}

			.price {
				font-family: PingFang SC, PingFang SC;
				font-weight: bold;
				font-size: 40rpx;
				color: #000000;
			}
		}
		.item:last-child{
			border: none;
		}
	}
</style>